if ( 'FBDEditor' in window ) ; else FBDEditor = {};
FBDEditor.view = function ( prnt, winView, cntrl, FBEditor ) {
/*
    view for FBDEditor 1.0
    Copyright (C) 2008-2009 Yuriy Butenko y.v.butenko@gmail.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
// create tools window
	var ctxt = this;
	var tButtonClick = function ( e ) {
		var x = e ? e.pageX : window.event.clientX;
		var y = e ? e.pageY : window.event.clientY;
		var nm = this.className.replace("FBDEditor_","").replace("Pressed","").replace(/B$/,"");
		setTimeout(function () { cntrl.send( "tbtnclick", x, y, nm ); }, 0 );
		return false;
	};
	var tw = new winView.win();
	tw.on();
	tw.setPos(10,10);
	tw.setDim(396,72);
	tw.setCaption("tools");
	tw.content.innerHTML = '<div class="FBDEditor_toolsBarDiv" style="padding:4px 8px;">&nbsp;</div>';
	tw.content.style.overflow = "hidden";
	tw.close = function () {};
	var tButtonsName = ['trace','move','copy','edit','del','fb','load','generate','save','help','about'];
	var tButtonsTitle = {
		'trace':'draw trace',
		'move':'move',
		'copy':'copy',
		'edit':'edit',
		'del':'delete',
		'fb':'define FB',
		'load':'load file',
		'generate':'code generate',
		'save':'save file',
		'help':'help',
		'about':'about'
	};
	var tButtons = {};
	for ( var i = 0, e; i < tButtonsName.length; i++ ) {
		tw.content.firstChild.insertBefore( e = document.createElement( "a" ), tw.content.firstChild.lastChild );
		e.className = "FBDEditor_" + tButtonsName[i] + "B";
		e.setAttribute( "title", tButtonsTitle[tButtonsName[i]] );	// TODO not work in FF
		tButtons[tButtonsName[i]] = e;
		e.setAttribute( "href","" );
		e.onclick = tButtonClick;
	};
	this.selectTButton = function ( txt ) {
		tButtons[txt].className = tButtons[txt].className.replace( "Pressed", "" ) + "Pressed";
	};
	this.unselectTButton = function ( txt ) {
		tButtons[txt].className = tButtons[txt].className.replace( "Pressed", "" );
	};
	this.isSelectTButton = function ( txt ) {
		return tButtons[txt].className.indexOf( "Pressed" ) != -1;
	};
	this.selectFBButton = function ( txt ) {
		fbButtons[txt].className = fbButtons[txt].className.replace( "Pressed", "" ) + "Pressed";
	};
	this.unselectFBButton = function ( txt ) {
		fbButtons[txt].className = fbButtons[txt].className.replace( "Pressed", "" );
	};
	this.isSelectFBButton = function ( txt ) {
		return fbButtons[txt].className.indexOf( "Pressed" ) != -1;
	};
// create status window
	var sw = new winView.win();
	sw.on();
	sw.autoheight = true;
	sw.resize = "horizontal";
	sw.setResize();
	sw.setPos(10,100);
	sw.setCaption("status");
	var cont = "";
	for ( var i = 0, str = '<div class="statusDiv">-</div>'; i < 6; cont += str, i++ ) ;
	sw.content.innerHTML = cont;
	for ( var i = sw.content.firstChild; i; i = i.nextSibling, i = i ? i.nextSibling : i ) i.className += "Odd";
	sw.content.style.overflow = "hidden";
	sw.close = function () {};
	this.message = function ( txt ) {
		sw.content.insertBefore(sw.content.removeChild(sw.content.lastChild),sw.content.firstChild);
		sw.content.firstChild.innerHTML = txt;
		var clrs = ["#000000","#282828","#505050","#787878","#a0a0a0","#c8c8c8"];
		for ( var i = sw.content.firstChild, clr = 0; i; i = i.nextSibling, clr++ ) i.style.color = clrs[clr];
	};
	sw.setDim(200,0);
// create FB window
	fbw = new winView.win();
	fbw.on();
	fbw.minHeight = 128;
	fbw.autoheight = false;
	fbw.setPos(10,270);
	fbw.setCaption("function blocks");
	fbw.content.className += " fbsContent";
	fbw.content.style.overflow = "auto";
	fbw.close = function () {};
	fbw.setDim(200,fbw.minHeight);
// fb button define
	var fbButtons = {};
	var fbButtonClick = function ( e ) {
		cntrl.send( "btnclick",
			e ? e.pageX : window.event.clientX,
			e ? e.pageY : window.event.clientY,
			this.firstChild.firstChild.nodeValue );
		return false;
	};
	this.addFBButton = function ( txt ) {
		fbw.content.appendChild( fbButtons[txt] = document.createElement( "a" ) );
		fbButtons[txt].innerHTML = "<span>"+txt+"</span>";
		fbButtons[txt].setAttribute( "href","" );
		fbButtons[txt].onclick = fbButtonClick;
	};
	this.delFBButton = function ( txt ) {
		fbw.content.removeChild( fbButtons[txt] );
		delete fbButtons[txt];
	};
// define fbedit window
	var fbedit = new FBEditor( prnt, winView, cntrl );
	fbedit.off();
	this.addFBlock = function ( id, inputs, outputs ) {
		return fbedit.add( id, inputs, outputs );
	};
	this.delFBlock = function ( h ) {
		fbedit.del( h );
	};
// ----
	var container = document.createElement( "div" );
	container.className = "FBDEditor_container";
	this.initContainer = function ( sel ) {
		prnt.appendChild( container );
		container.style.left = container.style.top = "0px";
		for ( var i = 0, l = sel.length; i < l; i++ )
			container.appendChild( sel[i].parentNode ? sel[i].parentNode.removeChild( sel[i] ) : sel[i] );
		return container;
	};
	this.deinitContainer = function () {
		while ( container.firstChild ) prnt.appendChild( container.removeChild( container.firstChild ) );
		container.parentNode && prnt.removeChild( container );
	};
	this.delContainer = function () {
		while ( container.firstChild ) container.removeChild( container.firstChild );
		container.parentNode && prnt.removeChild( container );
	};
	this._simple_onclick = function ( e ) {
		if ( !selection.selectFunction ) return;
		if ( ( e || window.event ).ctrlKey ) selection.selectFunction( null, null );
		else selection.selectFunction(
				this,
				{"x":e ? e.pageX : window.event.clientX,
				"y":e ? e.pageY : window.event.clientY}
			);
//		cntrl.send("click",e ? e.pageX : window.event.clientX,e ? e.pageY : window.event.clientY);
		if ( e ) e.stopPropagation();
		else window.event.cancelBubble = true;
	};
	this.drawTrace = function ( x0, y0, x1, y1, l0 ) {
		var e = document.createElement( "div" );
		prnt.appendChild(e);
		e.className = "FBDEditor_trace0";
		e.innerHTML = '<div class="FBDEditor_traceV"></div>'+
			'<div class="FBDEditor_traceH"></div>'+
			'<div class="FBDEditor_tCornerRT"></div>'+
			'<div class="FBDEditor_tCornerLB"></div>';
		this.redrawTrace( e, x0, y0, x1, y1, !!l0 ? l0 : -1 );
		e.onclick = this._simple_onclick;
		return e;
	};
	this.drawFB = function ( x, y, id, classId, inputs, outputs ) {
		var e, inStr = "", outStr = "";
		for ( var i = 0; i < inputs.length; i++ ) {
			inStr += '<div style="top:'+(i*16)+'px;">'+inputs[i]+'</div>';
		};
		for ( var i = 0; i < outputs.length; i++ ) {
			outStr += '<div style="top:'+(i*16)+'px;">'+outputs[i]+'</div>';
		};
		( e = document.createElement( "div" ) ).innerHTML =
			'<div class="FBDEditor_fbId">-</div>'+		//0
			'<div class="FBDEditor_fbClass">-</div>'+	//1
			'<div class="FBDEditor_fbHeader"></div>'+	//2
			'<div class="FBDEditor_fbFooter"></div>'+	//3
			'<div class="FBDEditor_fbInputs">'+inStr+'</div>'+	//4
			'<div class="FBDEditor_fbOutputs">'+outStr+'</div>'+	//5
			'<div class="FBDEditor_fbCover"></div>';	//6
		e.className = "FBDEditor_fb";
		prnt.appendChild(e);
		e.style.height = e.childNodes[3].style.top = Math.max( inputs.length, outputs.length ) * 16 + "px";
		e.style.left = x + "px";
		e.style.top = y + "px";
		this.setText( e, id );
		this.setClassId( e, classId );
		e.onclick = this._simple_onclick;
		return e;
	};
	this._drawNode = function ( className, x, y, txt ) {
		var e = document.createElement( "div" );
		prnt.appendChild(e);
		e.className = className;
		e.appendChild( document.createTextNode( "-" ) );
		this.setText( e, txt );
		e.style.left = x + "px";
		e.style.top = y + "px";
		e.onclick = this._simple_onclick;
		return e;
	};
	this.drawFrame = function ( x0, y0, x1, y1 ) {
		var e = document.createElement( "div" );
		prnt.appendChild(e);
		e.className = "FBDEditor_frame";
		return this.redrawFrame( e, x0, y0, x1, y1 );
	};
	this.displayAbout = function () {
		var txt = '<h1>FBDEditor 1.0</h1>'+
			'<p align="left">Home page: <a href="http://www.obers.net.ua/fbdeditor/">www.obers.net.ua/fbdeditor/</a><br>'+
			'<br>'+
			'Copyright (C) 2008-2009 <i style="color: green;">Yuriy Butenko</i><br>'+
			'<br>'+
			'This program is free software: you can redistribute it and/or modify<br>'+
			'it under the terms of the GNU General Public License as published by<br>'+
			'the Free Software Foundation, either version 3 of the License, or<br>'+
			'(at your option) any later version.<br>'+
			'<br>'+
			'This program is distributed in the hope that it will be useful,<br>'+
			'but WITHOUT ANY WARRANTY; without even the implied warranty of<br>'+
			'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>'+
			'GNU General Public License for more details.<br>'+
			'<br>'+
			'You should have received a copy of the GNU General Public License<br>'+
			'along with this program.  If not, see <a href="http://www.gnu.org/licenses/">www.gnu.org/licenses/</a>.</p>';
		winView.alert('about', txt, null, null, 512);
	};
	this.promptLoad = function ( defaultName, obj, cb ) {
		winView.prompt('load', '<p style="font-size:14px;">Enter file name</p>', defaultName, obj, cb, 512);
	};
	this.promptSave = function ( defaultName, obj, cb ) {
		winView.prompt('save', '<p style="font-size:14px;">Enter file name</p>', defaultName, obj, cb, 512);
	};
	this.editProperty = function ( txt, val, obj, cb ) {
		winView.prompt('edit property', '<p style="font-size:14px;">'+txt+'</p>', val, obj, cb, 300);
	};
	this.alert = function ( txt ) {
		winView.alert('message', txt, null, null, 512);
	};
	this.confirm = function ( title, txt, obj, cb ) {
		winView.confirm(title, txt, obj, cb, 512);
	};
	var helpWin = null;
	this.displayHelp = function () {
		var width = Math.floor(screen.availWidth * 0.75);
		var height = Math.floor(screen.availHeight * 0.75);
		try {
		if ( !helpWin || helpWin.closed ) {
			helpWin = window.open("help/index.html",
				"FBDEditor help",
				"width="+width+","
				+"height="+height+","
				+"scrollbars");
			helpWin && helpWin.moveTo( screen.availWidth - width >> 1, screen.availHeight - height >> 1 );
		} else {
			window.open("help/index.html","FBDEditor help");
		};
		} catch ( e ) {
			alert("popup windows are locked!");
		};
	};
	var PromptG = function () {
		winView.win.call( this );
		this.content.innerHTML =
			'<div style="text-align:center;font-size:14px;margin:15px 25px;">Enter file name:</div>'+
			'<div style="text-align:center;margin:15px 25px;"><input id="FBDEditor_promptGinput" style="width:80%;" /></div>'+
			'<div class="FBDEditor_genRadio"><p style="clear:both;padding:0;margin:0;">&nbsp;</p></div>'+
			'<div class="yWin_ButtonContainer" style="text-align:center;margin:15px 25px 8px 25px;"></div>';
		var inp = this.content.firstChild.nextSibling.firstChild;
		var radio = this.content.firstChild.nextSibling.nextSibling;
		var ok = new winView.button(), cncl = new winView.button();
		ok.content.innerHTML = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
		this.content.lastChild.appendChild( ok.e );
		cncl.content.innerHTML = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cancel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
		this.content.lastChild.appendChild( cncl.e );
		this.resize = false;
		this.setResize();
		var ctxt = this;
		var h;
		var curRButton;
		var f = ok.onclick = cncl.onclick = this.close = function () {
			ctxt.callback && ctxt.callback[1].call( ctxt.callback[0], (this == ok ? inp.value : null), curRButton.e.nextSibling.nodeValue );
			winView.unlock(h);
			ok.setOff();
			cncl.setOff();
			ctxt.off();
		};
		var radioonclick = function () {
			if ( this == curRButton ) {
				this.setOn();
				return;
			};
			curRButton.setOff();
			(curRButton = this).setOn();
		};
		this.go = function ( defaultName, linguages, defaultLinguage, obj, cb ) {
			this.callback = cb && [obj,cb];
			inp.value = inp.defaultValue = defaultName;	// IE have not defaultValue?
			while ( radio.firstChild.nextSibling ) radio.removeChild(radio.firstChild);
			for ( var i = 0, l = linguages.length; i < l; i++ ) {
				var d = document.createElement("div");
				var b = new winView.radioButton();
				b.onclick = radioonclick;
				d.appendChild( b.e );
				d.appendChild( document.createTextNode(linguages[i]) );
				radio.insertBefore( d, radio.lastChild );
				if ( linguages[i] == defaultLinguage ) ( curRButton = b ).setOn();
			};
			this.on();
			this.up();
			inp.select();
			var wwidth = window.innerWidth || document.body.clientWidth;
			this.setDim(Math.min( wwidth >> 1, 490),0);
			this.setPos( this.centerX(), this.centerY() );
			h = winView.lock( this, this.e );
		};
		inp.onkeydown = function (e) {
			if ( ( e || window.event).keyCode == 13 ) f.call(ok);
		};
		this.setCaption("code generate");
		this.autoheight = true;
	};
	PromptG.prototype = winView.win.prototype;
	var promptG = new PromptG();
	this.promptGenerator = function ( defaultName, linguages, defaultLing, obj, cb ) {
		promptG.go( defaultName, linguages, defaultLing, obj, cb );
	};
	this.displayFBEditor = function () {
		fbedit.on();
	};
	this.hideFBEditor = function () {
		fbedit.off();
	};
	this.addFBToFBEditor = function ( id, inputs, outputs ) {
		fbedit.add( id, inputs, outputs );
	};
	this.delFBOutFBEditor = function ( id ) {
		fbedit.del( id );
	};
	this.getDefOutFBEditor = function () {
		return fbedit.getDef();
	};
	this.setDefToFBEditor = function ( blks ) {
		return fbedit.setDef( blks );
	};
	var TextIO =  function () {
		winView.win.call( this );
		this.content.innerHTML = '<div style="margin:8px;"><textarea style="width:100%;height:300px;"></textarea></div>'
			+ '<div class="yWin_ButtonContainer" style="text-align:center;margin:15px 25px 8px 25px;"></div>';
		var text = this.content.firstChild.firstChild;
		var ok = new winView.button(), cncl = new winView.button();
		ok.content.innerHTML = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
		this.content.lastChild.appendChild( ok.e );
		cncl.content.innerHTML = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cancel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
		this.content.lastChild.appendChild( cncl.e );
		var ctxt = this;
		var h;
		var f = ok.onclick = cncl.onclick = this.close = function () {
			ctxt.callback && ctxt.callback[1].call( ctxt.callback[0], this == ok ? text.value : null );
			winView.unlock(h);
			ok.setOff();
			cncl.setOff();
			ctxt.off();
		};
		this.go = function ( title, txt, obj, cb ) {
			this.callback = cb && [obj,cb];
			text.value = txt;
			this.setCaption(title);
			this.on();
			this.up();
			var wwidth = window.innerWidth || document.body.clientWidth;
			this.setDim(Math.min( wwidth >> 1, 400),0);
			this.setPos( this.centerX(), this.centerY() );
			h = winView.lock( this, this.e );
			ctxt.up();
			text.select();
		};
		this.autoheight = true;
	};
	this.textIn = function ( cb ) {
		textIO.go( "input text for read", "", null, cb );
	};
	this.textOut = function ( text, cb ) {
		textIO.go( "text for output", text, null, cb );
	};
	this.codeOut = function ( text, cb ) {
		textIO.go( "take your code", text, null, cb );
	};
	this._moveWinTo = function ( title, x, y ) {	// only for Demo mode
		if ( title == "tools" ) tw.setPos( x, y );
		else if ( title == "status" ) sw.setPos( x, y );
		else if ( title == "function blocks" ) fbw.setPos( x, y );
	};
	TextIO.prototype = winView.win.prototype;
	var textIO = new TextIO();
	document.onclick = function ( e ) {
		if ( getPoint.clickFunction ) {
			if ( ( e || window.event ).ctrlKey ) getPoint.clickFunction( null );
			else getPoint.clickFunction(
					{"x":e ? e.pageX : window.event.clientX,
					"y":e ? e.pageY : window.event.clientY}
				);
		};
		if ( e ) e.stopPropagation();
		else window.event.cancelBubble = true;
	};
	document.onmousemove = function ( e ) {
		getPoint.dragFunction &&
			getPoint.dragFunction(
				{"x":e ? e.pageX : window.event.clientX,
				"y":e ? e.pageY : window.event.clientY}
			);
		if ( e ) e.stopPropagation();
		else window.event.cancelBubble = true;
	};
	var getPoint = this.getPoint = function ( clickFunction, dragFunction ) {
		getPoint.clickFunction = clickFunction;
		getPoint.dragFunction = dragFunction;
	};
	var selection = this.selection = function ( selectFunction ) {
		selection.selectFunction = selectFunction;
	};
};

FBDEditor.view.prototype = {
	"message":function ( txt ) {},
	"addFBButton":function ( txt ) {},
	"delFBButton":function ( txt ) {},
	"addFBlock":function ( id, inputs, outputs ) {},
	"delFBlock":function ( id ) {},
	"initContainer":function ( sel ) {},	// sel: array of handler
	"deinitContainer":function () {},
	"selectFBButton":function ( txt ) {},
	"unselectFBButton":function ( txt ) {},
	"isSelectFBButton":function ( txt ) {},
	"selectTButton":function ( txt ) {},
	"unselectTButton":function ( txt ) {},
	"isSelectTButton":function ( txt ) {},
	"drawTrace":function ( x0, y0, x1, y1, l0 ) {},
	"_drawNode":function ( className, x, y, txt ) {},
	"drawFB":function ( x, y, id, classId, inputs, outputs ) {},
	"drawFrame":function ( x0, y0, x1, y1 ) {},
	"redrawFrame":function ( e, x0, y0, x1, y1 ) {
		e.style.left = Math.min(x0,x1) + "px";
		e.style.top = Math.min(y0,y1) + "px";
		e.style.width = Math.max(Math.abs(x1 - x0),2) + "px";
		e.style.height = Math.max(Math.abs(y1 - y0),2) + "px";
		return e;
	},
	"onEntity":function ( h ) {
		h.style.display = "";
		return h;
	},
	"offEntity":function ( h ) {
		h.style.display = "none";
		return h;
	},
	"upEntity":function ( h ) {
		h.parentNode.appendChild( h.parentNode.removeChild( h ) );
		return h;
	},
	"redrawTrace":function ( h, x0, y0, x1, y1, l0 ) {
		if ( typeof l0 != "number" ) l0 = -1;
		var dX = x1 - x0;
		var dY = y1 - y0;
		var s0 = h.style;
		s0.width = "";
		s0.height = "";
		if ( !dX ) {
			if ( !dY ) {
				h.className = "FBDEditor_trace0";
				s0.left = x0 - 7 + "px";
				s0.top = y0 - 7 + "px";
			} else {
				h.className = "FBDEditor_traceV0";
				s0.left = x0 - 2 + "px";
				s0.top = Math.min(y0,y1) + "px";
				s0.height = Math.abs(dY) + 1 + "px";
			};
		} else if ( !dY ) {
			h.className = "FBDEditor_traceH0";
			s0.left = Math.min(x0,x1) + "px";
			s0.top = y0 - 2 + "px";
			s0.width = Math.abs(dX) + 1 + "px";
		} else {
			h.className = "FBDEditor_traceH";
			var i, revers;
			if ( revers = x0 > x1 ) {
				i = x0;
				x0 = x1;
				x1 = i;
				i = y0;
				y0 = y1;
				y1 = i;
			};
			var lSegm0 = Math.min( l0 == -1 ? x1 - x0 + 1 >> 1 : l0, x1 - x0 - 2 );
			s0.left = x0 + "px";
			s0.top = y0 - 2 + "px";
			var x_1 = s0.width = ( revers ? x1 - x0 - lSegm0 - 1 : lSegm0 - 2 ) + "px";
			( i = h.childNodes[0] ).style.top = ( y0 < y1 ? 4 : y1 - y0 + 4 ) + "px";
			i.style.left = x_1;
			i.style.height = Math.abs(dY) - 4 + "px";
			( i = i.nextSibling ).style.left = ( revers ? x1 - x0 - lSegm0 + 3 : lSegm0 + 2 ) + "px";
			i.style.top = y1 - y0 + "px";
			i.style.width = ( revers ? lSegm0 - 2 : x1 - x0 - lSegm0 - 1 ) + "px";
			( i = i.nextSibling ).className = y0 < y1 ? "FBDEditor_tCornerRT" : "FBDEditor_tCornerRB";
			i.style.left = x_1;
			( i = i.nextSibling ).style.top = y1 - y0 + "px";
			i.style.left = x_1;
			i.className = y0 < y1 ? "FBDEditor_tCornerLB" : "FBDEditor_tCornerLT";
		};
		return h;
	},
	"drawVari":function ( x, y, txt ) {
		return this._drawNode( "FBDEditor_vari", x, y, txt );
	},
	"drawConsta":function ( x, y, txt ) {
		return this._drawNode( "FBDEditor_consta", x, y, txt );
	},
	"drawInput":function ( x, y, txt ) {
		return this._drawNode( "FBDEditor_input", x, y, txt );
	},
	"drawOutput":function ( x, y, txt ) {
		return this._drawNode( "FBDEditor_output", x, y, txt );
	},
	"getDX":function ( h ) {	// only for fb, vari, consta, input, output
		return h.offsetWidth;
	},
	"getDY":function ( h ) {	// only for fb, vari, consta, input, output
		return h.offsetHeight;
	},
	"setText":function ( h, txt ) {	// only for fb, vari, consta, input, output
		txt = txt || "-";
		if ( h.className.indexOf("FBDEditor_fb") != 0 ) h.firstChild.nodeValue = txt;
		else h.firstChild.firstChild.nodeValue = txt;
		return h;
	},
	"setClassId":function ( h, classId ) {	// only for fb
		h.firstChild.nextSibling.firstChild.nodeValue = classId || "-";
		return h;
	},
	"createContainer":function () {},
	"_attrName":"FBDEditor",
	"getAttr":function ( h ) {
		return h[this._attrName];
	},
	"setAttr":function ( h, v ) {
		return h[this._attrName] = v;
	},
	"isSelect":function ( h ) {
		return h.className.indexOf( "Selected" ) != -1;
	},
	"select":function ( h ) {
		h.className = h.className.replace( "Selected", "" ) + "Selected";
		return h;
	},
	"unselect":function ( h ) {
		h.className = h.className.replace("Selected","");
		return h;
	},
	"moveBy":function ( h, dX, dY ) {
		h.style.left = parseInt( h.style.left ) + dX + "px";
		h.style.top = parseInt( h.style.top ) + dY + "px";
		return h;
	},
	"moveTo":function ( h, x, y ) {
		h.style.left = x + "px";
		h.style.top = y + "px";
		return h;
	},
	"del":function ( h ) {
		h.parentNode && h.parentNode.removeChild( h );
		h[this._attrName] = null;
	},
	"copy":function ( h ) {
		var x = h.cloneNode( true );
		x.onclick = h.onclick;
		x[this._attrName] = null;
		return x;
	},
	"editProperty":function ( txt, val, obj, cb ) {},
	"displayAbout":function () {},
	"propmtSave":function ( defaultName, obj, cb ) {},
	"propmtLoad":function ( defaultName, obj, cb ) {},
	"displayHelp":function () {},
	"promptGenerator":function ( defaultName, linguages, defaultLing, obj, cb ) {},
	"displayFBEditor":function () {},
	"hideFBEditor":function () {},
	"addFBToFBEditor":function ( id, inputs, outputs ) {},
	"delFBOutFBEditor":function ( id ) {},
	"getDefOutFBEditor":function () {},
	"getPoint":function ( obj ) {},
	"terminateDrag":function () {}
}
